# -*- coding = utf-8 -*-
# @Time: 2023-10-24 23:49
# @Author: DavidXie03
# @File: urls.py
# @Software: PyCharm

from django.urls import path

from . import views

app_name = "delivery_database"

urlpatterns = [
    # administrator
    path('canteen/?id=<int>/', views.CanteenList.as_view(), name="canteen_list"), # 将类视图转换为可调用的视图函数
    path("canteen/?id=<int>/create/", views.CanteenCreateView.as_view(), name="canteen_create"),
    path('canteen/?id=<int:id>/<int:pk>/', views.CanteenDetail.as_view(), name="canteen_detail"),
    path('canteen/?id=<int:id>/<int:pk>/delete/', views.CanteenDelete.as_view(), name="canteen_delete"),
    path('canteen/?id=<int:id>/<int:pk>/update/', views.CanteenUpdate.as_view(), name="canteen_update"),

    # seller
    path('seller/?id=<int>', views.SellerMenu.as_view(), name="seller_menu"),
    
    path('seller/?id=<int>/store/', views.StoreList.as_view(), name="seller_store_list"),
    path('seller/?id=<int>/store/create', views.StoreCreateView.as_view(), name="seller_store_create"),
    path('seller/?id=<int:id>/store/<int:pk>', views.StoreDetail.as_view(), name="seller_store_detail"),
    path('seller/?id=<int:id>/store/<int:pk>/delete/', views.StoreDelete.as_view(), name="seller_store_delete"),
    path('seller/?id=<int:id>/store/<int:pk>/update/', views.StoreUpdate.as_view(), name="seller_store_update"),
    
    path('seller/?id=<int>/food/', views.FoodList.as_view(), name="seller_food_list"),
    path('seller/?id=<int>/food/create', views.FoodCreateView.as_view(), name="seller_food_create"),
    path('seller/?id=<int:id>/food/<int:pk>', views.FoodDetail.as_view(), name="seller_food_detail"),
    path('seller/?id=<int:id>/food/<int:pk>/delete/', views.FoodDelete.as_view(), name="seller_food_delete"),
    path('seller/?id=<int:id>/food/<int:pk>/update/', views.FoodUpdate.as_view(), name="seller_food_update"),

    path('seller/?id=<int>/order/', views.OrderList.as_view(), name="seller_order_list"),
    path('seller/?id=<int:id>/order/<int:pk>', views.OrderDetail.as_view(), name="seller_order_detail"),
    path('seller/?id=<int:id>/order/<int:pk>/update/', views.OrderUpdate.as_view(), name="seller_order_update"),
    
    # normalUser
    path('normal_user/?id=<int>/', views.NormalUserMenu.as_view(), name="normal_user_menu"),
    path('normal_user/?id=<int:id>/setting/<int:pk>', views.NormalUserSetting.as_view(), name="normal_user_setting"),

    path('normal_user/?id=<int>/food/', views.NormalUserFoodList.as_view(), name="normal_user_food_list"),
    path('normal_user/?id=<int:id>/food/<int:pk>/', views.NormalUserFoodOrder.as_view(), name="normal_user_food_order"),

    path('normal_user/?id=<int>/order/', views.NormalUserOrderList.as_view(), name="normal_user_order_list"),
    path('normal_user/?id=<int:id>/order/<int:pk>', views.NormalUserOrderDetail.as_view(), name="normal_user_order_detail"),
]